#include<iostream>


class Base
{
public:
    virtual void show()
    {


        std::cout<<"a"<<std::endl;
    }

protected:
    int a;
};


class Derived1:public Base
{
public:
void show()
{


    std::cout<<"derived1"<<std::endl;

}
};
class Derived2:public Base
{
public:
void show()
{


    std::cout<<"derived2"<<std::endl;

}
};



int main()
{   
    // //向上转型
    // Base*d=new Derived;//基类的指针指向子类的对象
    // d->show();
    // Base*a[2];
    // a[0]=new Derived1;
    // a[1]=new Derived2;

    // //多态
    // for (int i = 0; i <2; i++)
    // {
    //     a[i]->show();
    // }
    


    return 0;

}



